package com.hetaozi.login.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @email： wf520200@163.com
 * @date: 2021/11/11 15:21
 * 功能：
 * 描述：
 * @author： 吴帆
 **/
@Api(tags = "用户接口")
@RestController
@RequestMapping("/user")
public class UserController {


    @ApiOperation(value = "新增用户")
    @RequiresPermissions(value = "user:add")
    @PostMapping("/add")
    public String add(){
        return "新增用户成功！";
    }

    @ApiOperation(value = "修改用户")
    @RequiresPermissions(value = "user:update")
    @PostMapping("/update")
    public String update(){
        return "修改用户";
    }

    @ApiOperation(value = "用户列表查询")
    @RequiresPermissions(value = "user:list")
    @PostMapping("/list")
    public String list(){
        return "用户列表查询";
    }

    @ApiOperation(value = "超级用户测试没有权限")
    @RequiresPermissions(value = "user:unPermission")
    @PostMapping("/unPermission")
    public String unPermission(){
        return "505";
    }
}
